import random
import string



# 包含特殊字符,n 为所需要的长度
def random_specpun(n):
    random_string = ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k=n))
    return random_string
# 仅包含数字和字母， 为所需要的长度
def random_digstr(n):
    random_string = ''.join(random.choices(string.ascii_letters + string.digits, k=n))
    return random_string

if __name__ == '__main__':
    specpun = random_specpun(10)
    print(specpun)
    digstr = random_digstr(2000)
    print(digstr)

